<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri="http://ckeditor.com" prefix="ckeditor" %>
<%@ taglib uri="/struts-tags" prefix="s"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link type="text/css" rel="stylesheet" href="../ckeditor/_samples/sample.css" />
</head>
<%
String path = request.getContextPath();
%>
<script type="text/javascript" src="<%=path %>/js/jquery-1.4.4.js"></script>

<body>
<a href="javascript:void(0)" onclick="changeLanguage(this)" value="zh_CN"><s:text name="chinese"></s:text></a>
<a href="javascript:void(0)" onclick="changeLanguage(this)" value="en_US"><s:text name="englisth"></s:text></a>

<form action="<%=path %>/addnews.action" method="post" enctype="multipart/form-data">

	<s:text name="submit"></s:text><input type="text" name="title">
	<s:text name="attachfile"></s:text><input type="file" name="attachfile">
	
	<textarea cols="80" id="content" name="content" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea>
	
	<input type="submit" value="<s:text name="submit"></s:text>" >
</form>

<ckeditor:replace  replace="content" basePath="../ckeditor/" />
</body>
</html>

<script>

$(function(){
	
});

function changeLanguage(obj){
	var param = obj.value;
	$.ajax({
		type: "POST",
		url: "<%=path %>/languageChange.action",
		data: {"language":param,datetime:new Date().getTime()},
		async: false,
		
		success: function(msg){
		  window.location.reload();
		}
	});
	
}
</script>


